package com.we823.cms.common.web.pageable;

/**
 * 方向枚举类型
 * Created by ZhangYinxian on 2016-10-20.
 */
public enum Direction {
    ASC("asc"),DESC("desc");

    private String name;

    Direction(String name){
        this.name = name;
    }

    public static Direction parse(String name){
        if (name==null) return ASC;
        if (name.toLowerCase().equals("asc")){
            return ASC;
        }else{
            return DESC;
        }
    }

    public String getName(){
        return this.name;
    }
}
